package com.hanserwei.mydemo.stream;

import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;

public class CollectTest2 {

    public static void main(String[] args) {
        Stream<String> stream = Stream.of("令狐冲", "风清扬", "独孤求败", "方证", "东方不败", "冲虚", "向问天", "任我行", "不戒", "东方不败", "冲虚", "向问天");
        HashMap<String, Integer> hashMap = stream.collect(HashMap::new, (m, v) -> m.put(v, 1), (a, b) -> {
        });
        for (Map.Entry<String, Integer> stringIntegerEntry : hashMap.entrySet()) {
            System.out.print(stringIntegerEntry.getKey() + " ");
        }
    }
}
